package main

import "fmt"

type Student struct {
	name string
	age int
	married bool
	gender int8
}

func main() {
	s1:=Student{"Steven",35,true,1}
	s2:=Student{"Sunny",20,false,0}

	var a *Student = &s1
	var b *Student = &s2

	fmt.Println("\n------------------------")
	fmt.Printf("s1的类型：%T,s1的值：%v \n",s1,s1)
	fmt.Printf("s2的类型：%T,s2的值：%v \n",s2,s2)

	fmt.Println("\n------------------------")
	fmt.Printf("a的类型：%T,a的值：%v \n",a,a)
	fmt.Printf("b的类型：%T,b的值：%v \n",b,b)

	fmt.Println("\n------------------------")
	fmt.Printf("*a的类型：%T,*a的值：%v \n",*a,*a)
	fmt.Printf("*b的类型：%T,*b的值：%v \n",*b,*b)

	fmt.Println("\n------------------------")
	fmt.Printf("&s1的类型：%T,&s1的值：%v \n",&s1,&s1)
	fmt.Printf("&s2的类型：%T,&s2的值：%v \n",&s2,&s2)

	fmt.Println("\n------------------------")
	fmt.Println(s1.name, s1.age,s1.gender,s1.married)
	fmt.Println(a.name, a.age,a.gender,a.married)

	fmt.Println("\n------------------------")
	fmt.Println((*a).name, (*a).age,(*a).gender,(*a).married)
	fmt.Println(&a.name, &a.age,&a.gender,&a.married)
}
